Model run by stephane.hess using Apollo 0.3.9 on R 4.5.3 for Darwin. Please acknowledge the use of Apollo by citing Hess & Palma (2019) DOI 10.1016/j.jocm.2019.100170 www.ApolloChoiceModelling.com Model name : CNL_constraint_on_alphas Model description : CNL model with socio-demographics on mode choice SP data, with constraint on alphas Model run at : 2026-07-05 15:57:25.386011 Estimation method : bfgs Estimation diagnosis : successful convergence Optimisation diagnosis : Unknown (no Hessian calculated) Number of individuals : 500 Number of rows in database : 7000 Number of modelled outcomes : 7000 Number of cores used : 1 Model without mixing LL(start) : -4830.94 LL at equal shares, LL(0) : -8196.02 LL at observed shares, LL(C) : -6706.94 LL(final) : -4742.25 Rho-squared vs equal shares : 0.4214 Adj.Rho-squared vs equal shares : 0.4188 Rho-squared vs observed shares : 0.2929 Adj.Rho-squared vs observed shares : 0.2903 AIC : 9526.5 BIC : 9670.42 Estimated parameters : 21 Time taken (hh:mm:ss) : 00:00:38.06 pre-estimation : 00:00:0.19 estimation : 00:00:37.84 post-estimation : 00:00:0.03 Iterations : 217 Constrained optimisation: alpha_rail_fastPT + alpha_rail_groundPT = 1 Estimates: Estimate BHHH.s.e. BHHH.t.rat.(0) BHHH.t.rat.(1) asc_car 0.000000 NA NA NA asc_bus 0.299027 NA NA NA asc_air -0.646477 NA NA NA asc_rail -1.563645 NA NA NA asc_bus_interaction_female 0.273633 NA NA NA asc_air_interaction_female 0.240316 NA NA NA asc_rail_interaction_female 0.178830 NA NA NA b_tt_car -0.010391 NA NA NA b_tt_bus -0.016555 NA NA NA b_tt_air -0.013073 NA NA NA b_tt_rail -0.005460 NA NA NA b_tt_interaction_business -0.006010 NA NA NA b_access -0.017829 NA NA NA b_cost -0.057587 NA NA NA b_cost_interaction_business 0.023261 NA NA NA cost_income_elast -0.620999 NA NA NA b_no_frills 0.000000 NA NA NA b_wifi 0.774408 NA NA NA b_food 0.337793 NA NA NA lambda_fastPT 0.401188 NA NA NA lambda_groundPT 0.528457 NA NA NA alpha_rail_fastPT 0.492907 NA NA NA alpha_rail_groundPT 0.507094 NA NA NA Structure for CNL model component : car (alpha) bus (alpha) air (alpha) rail (alpha) lambda car nest 1.000 0.000 0.000 0.0000 1.0000 groundPT nest 0.000 1.000 0.000 0.5071 0.5285 fastPT nest 0.000 0.000 1.000 0.4929 0.4012 Overview of choices for CNL model component : car bus air rail Times available 5446.00 6314.00 5264.00 6118.00 Times chosen 1946.00 358.00 1522.00 3174.00 Percentage chosen overall 27.80 5.11 21.74 45.34 Percentage chosen when available 35.73 5.67 28.91 51.88 BHHH covariance matrix: asc_bus asc_air asc_rail asc_bus_interaction_female asc_air_interaction_female asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA asc_rail_interaction_female b_tt_car b_tt_bus b_tt_air b_tt_rail asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA b_tt_interaction_business b_access b_cost b_cost_interaction_business cost_income_elast asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA b_wifi b_food lambda_fastPT lambda_groundPT alpha_rail_fastPT asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA alpha_rail_groundPT asc_bus NA asc_air NA asc_rail NA asc_bus_interaction_female NA asc_air_interaction_female NA asc_rail_interaction_female NA b_tt_car NA b_tt_bus NA b_tt_air NA b_tt_rail NA b_tt_interaction_business NA b_access NA b_cost NA b_cost_interaction_business NA cost_income_elast NA b_wifi NA b_food NA lambda_fastPT NA lambda_groundPT NA alpha_rail_fastPT NA alpha_rail_groundPT NA BHHH correlation matrix: asc_bus asc_air asc_rail asc_bus_interaction_female asc_air_interaction_female asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA asc_rail_interaction_female b_tt_car b_tt_bus b_tt_air b_tt_rail asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA b_tt_interaction_business b_access b_cost b_cost_interaction_business cost_income_elast asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA b_wifi b_food lambda_fastPT lambda_groundPT alpha_rail_fastPT asc_bus NA NA NA NA NA asc_air NA NA NA NA NA asc_rail NA NA NA NA NA asc_bus_interaction_female NA NA NA NA NA asc_air_interaction_female NA NA NA NA NA asc_rail_interaction_female NA NA NA NA NA b_tt_car NA NA NA NA NA b_tt_bus NA NA NA NA NA b_tt_air NA NA NA NA NA b_tt_rail NA NA NA NA NA b_tt_interaction_business NA NA NA NA NA b_access NA NA NA NA NA b_cost NA NA NA NA NA b_cost_interaction_business NA NA NA NA NA cost_income_elast NA NA NA NA NA b_wifi NA NA NA NA NA b_food NA NA NA NA NA lambda_fastPT NA NA NA NA NA lambda_groundPT NA NA NA NA NA alpha_rail_fastPT NA NA NA NA NA alpha_rail_groundPT NA NA NA NA NA alpha_rail_groundPT asc_bus NA asc_air NA asc_rail NA asc_bus_interaction_female NA asc_air_interaction_female NA asc_rail_interaction_female NA b_tt_car NA b_tt_bus NA b_tt_air NA b_tt_rail NA b_tt_interaction_business NA b_access NA b_cost NA b_cost_interaction_business NA cost_income_elast NA b_wifi NA b_food NA lambda_fastPT NA lambda_groundPT NA alpha_rail_fastPT NA alpha_rail_groundPT NA Settings and functions used in model definition: apollo_control -------------- Value modelDescr "CNL model with socio-demographics on mode choice SP data, with constraint on alphas" indivID "ID" outputDirectory "output/" debug "FALSE" modelName "CNL_constraint_on_alphas" nCores "1" workInLogs "FALSE" seed "13" mixing "FALSE" HB "FALSE" noValidation "FALSE" noDiagnostics "FALSE" calculateLLC "TRUE" analyticHessian "FALSE" dropLoopExpansion "FALSE" dropRedefCheck "FALSE" memorySaver "FALSE" panelData "TRUE" analyticGrad "TRUE" analyticGrad_manualSet "FALSE" overridePanel "FALSE" preventOverridePanel "FALSE" noModification "FALSE" Hessian routines attempted -------------------------- none apollo_probabilities ---------------------- function(apollo_beta, apollo_inputs, functionality="estimate"){ ### Attach inputs and detach after function exit apollo_attach(apollo_beta, apollo_inputs) on.exit(apollo_detach(apollo_beta, apollo_inputs)) ### Create list of probabilities P P = list() ### Create alternative specific constants and coefficients using interactions with socio-demographics asc_bus_value = asc_bus + asc_bus_interaction_female * female asc_air_value = asc_air + asc_air_interaction_female * female asc_rail_value = asc_rail + asc_rail_interaction_female * female b_tt_car_value = b_tt_car + b_tt_interaction_business * business b_tt_bus_value = b_tt_bus + b_tt_interaction_business * business b_tt_air_value = b_tt_air + b_tt_interaction_business * business b_tt_rail_value = b_tt_rail + b_tt_interaction_business * business b_cost_value = ( b_cost + b_cost_interaction_business * business ) * ( income / mean_income ) ^ cost_income_elast ### List of utilities: these must use the same names as in cnl_settings, order is irrelevant V = list() V[["car"]] = asc_car + b_tt_car_value * time_car + b_cost_value * cost_car V[["bus"]] = asc_bus_value + b_tt_bus_value * time_bus + b_access * access_bus + b_cost_value * cost_bus V[["air"]] = asc_air_value + b_tt_air_value * time_air + b_access * access_air + b_cost_value * cost_air + b_no_frills * ( service_air == 1 ) + b_wifi * ( service_air == 2 ) + b_food * ( service_air == 3 ) V[["rail"]] = asc_rail_value + b_tt_rail_value * time_rail + b_access * access_rail + b_cost_value * cost_rail + b_no_frills * ( service_rail == 1 ) + b_wifi * ( service_rail == 2 ) + b_food * ( service_rail == 3 ) ### Specify nests for CNL model cnlNests = list(car=1,groundPT=lambda_groundPT,fastPT=lambda_fastPT) ### Specify tree structure, showing membership in nests (one row per nest, one column per alternative) cnlStructure = matrix(0, nrow=length(cnlNests), ncol=length(V)) cnlStructure[1,] = c( 1, 0, 0, 0 ) # car cnlStructure[2,] = c( 0, 1, 0, alpha_rail_groundPT) # groundPT cnlStructure[3,] = c( 0, 0, 1, alpha_rail_fastPT ) # fastPT ### Define settings for CNL model cnl_settings = list( alternatives = c(car=1, bus=2, air=3, rail=4), avail = list(car=av_car, bus=av_bus, air=av_air, rail=av_rail), choiceVar = choice, utilities = V, cnlNests = cnlNests, cnlStructure = cnlStructure ) ### Compute probabilities using CNL model P[["model"]] = apollo_cnl(cnl_settings, functionality) ### Take product across observation for same individual P = apollo_panelProd(P, apollo_inputs, functionality) ### Prepare and return outputs of function P = apollo_prepareProb(P, apollo_inputs, functionality) return(P) }